/**
 * 
 */
package cn.agiledata.bank.myspace.service;

import cn.agiledata.bank.common.util.PageBean;
import cn.agiledata.bank.hibernateBean.PeerBankAccount;
import cn.agiledata.bank.hibernateBean.PeerInnerAccount;
import cn.agiledata.bank.myspace.bean.PeerBankAccountBean;
import cn.agiledata.bank.myspace.bean.PeerBankAccountQueryBean;
import cn.agiledata.bank.myspace.bean.PeerInnerAccountBean;
import cn.agiledata.bank.myspace.bean.PeerInnerAccountQueryBean;
import cn.agiledata.bank.myspace.exception.MySpaceException;

/**
 * @author Administrator
 *
 */
public class PeerAccountServiceImpl implements PeerAccountService {
	private PeerInnerAccountService peerInnerAccountService;
	private PeerBankAccountService peerBankAccountService;
	public PeerBankAccountService getPeerBankAccountService() {
		return peerBankAccountService;
	}
	public void setPeerBankAccountService(
			PeerBankAccountService peerBankAccountService) {
		this.peerBankAccountService = peerBankAccountService;
	}
	public PeerInnerAccountService getPeerInnerAccountService() {
		return peerInnerAccountService;
	}
	public void setPeerInnerAccountService(
			PeerInnerAccountService peerInnerAccountService) {
		this.peerInnerAccountService = peerInnerAccountService;
	}
	
	public PageBean getPeerInnerAccountList(PeerInnerAccountQueryBean bean) {
		// TODO Auto-generated method stub
		return peerInnerAccountService.getPeerInnerAccountList(bean);
	}
	/**
	 * 根据联系人id得到联系人
	 * @param id
	 * @return
	 */
	public PeerInnerAccount getPeerInnerAccount(long id) {
		return peerInnerAccountService.getPeerInnerAccount(id);
	}
	public String validateEmailOrMobile(String emailOrMobile,String myAccountId) throws MySpaceException {
		// TODO Auto-generated method stub
		return peerInnerAccountService.validateEmailOrMobile(emailOrMobile,myAccountId);
	}
	/**
	 * 保存关联账户
	 * @param p
	 */
	public void peerInnerAccountAdd(PeerInnerAccountBean bean) throws MySpaceException {
		peerInnerAccountService.peerInnerAccountAdd(bean);
	}
	/**
	 * 修改关联账户
	 * @param id
	 * @throws MySpaceException
	 */
	public void peerInnerAccountModify(PeerInnerAccountBean bean)  throws MySpaceException {
		peerInnerAccountService.peerInnerAccountModify(bean);
	}
	/**
	 * 删除关联账户
	 * @param id
	 */
	public void peerInnerAccountDelete(String id) {
		peerInnerAccountService.peerInnerAccountDelete(id);
	}

	/**
	 * 得到银行账户列表
	 * @param bean
	 * @return
	 */
	public PageBean getPeerBankAccountList(PeerBankAccountQueryBean bean) {
		// TODO Auto-generated method stub
		return peerBankAccountService.getPeerBankAccountList(bean);
	}
	
	/**
	 * 根据联系人id得到银行联系人
	 * @param peerAccountId
	 * @return
	 */
	public PeerBankAccount getPeerBankAccount(long peerAccountId) {
		// TODO Auto-generated method stub
		return peerBankAccountService.getPeerBankAccount(peerAccountId);
	}
	
	/**
	 * 新增银行联系人
	 * @param bean
	 * @throws MySpaceException
	 */
	public void peerBankAccountAdd(PeerBankAccountBean bean) throws MySpaceException {
		// TODO Auto-generated method stub
		peerBankAccountService.peerBankAccountAdd(bean);
	}
	
	/**
	 * 修改银行联系人
	 * @param bean
	 * @throws MySpaceException
	 */
	public void peerBankAccountModify(PeerBankAccountBean bean) throws MySpaceException {
		// TODO Auto-generated method stub
		peerBankAccountService.peerBankAccountModify(bean);
	}
	
	/**
	 * 删除银行联系人
	 * @param peerAccountId
	 */
	public void peerBankAccountDelete(String peerAccountId) {
		// TODO Auto-generated method stub
		peerBankAccountService.peerBankAccountDelete(peerAccountId);
	}
	
	/**
	 * 验证是否是新的银行联系人(不重复,可添加)
	 * @param myAccountId
	 * @param cardNo
	 * @return
	 */
	public boolean isNewPeerBankAccount(String myAccountId, String cardNo) {
		// TODO Auto-generated method stub
		return peerBankAccountService.isNewPeerBankAccount(myAccountId, cardNo);
	}
	
	/**
	 * 新增银行联系人(在提交账户直付信息之前)
	 * @param bean
	 * @return
	 */
	public int peerBankAccountAddBeforeDrawToOther(PeerBankAccountBean bean) {
		// TODO Auto-generated method stub
		return peerBankAccountService.peerBankAccountAddBeforeDrawToOther(bean);
	}
}
